package com.jule.goldfast.base.enums;

/**
 * 游戲类型枚举
 * @author ran.wang
 * @since 2018/10/31 17:23
 */
public enum GameEnums {

    DOMINO_COMMON(1, 71001001, "71001001", "通比牌九"),
    GOLD_FAST(2, 72001001, "72001001", "急速炸金花"),;


    //序列
    private int index;
    //游戏
    private int gameId;
    //游戏
    private String game;
    //注释
    private String comments;

    GameEnums(int index, int gameId, String game, String comments) {
        this.index = index;
        this.gameId = gameId;
        this.game = game;
        this.comments = comments;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public int getGameId() {
        return gameId;
    }

    public void setGameId(int gameId) {
        this.gameId = gameId;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public String getGame() {
        return game;
    }

    public void setGame(String game) {
        this.game = game;
    }

    public static int getGameByIndex(int index){
        for (GameEnums enums : GameEnums.values()){
            if (enums.getIndex() == index){
                return enums.getGameId();
            }
        }
        return DOMINO_COMMON.gameId;
    }
}
